package game.socket;

import dou.net.socket.AbstractClientSocket;
import dou.net.socket.AbstractServerSocket;
import dou.net.socket.IServerSocket;

import java.io.IOException;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;

/**
 * 定义了一个远程服务类
 * @author wizardc
 */
public class RemoteServerSocket extends AbstractServerSocket
{
    /**
     * 创建一个 RemoteServerSocket 对象
     */
    public RemoteServerSocket()
    {
        super("remote_server", 16, 32);
    }

    @Override
    protected boolean checkClientIP(SocketChannel socketChannel)
    {
        return true;
    }

    @Override
    protected AbstractClientSocket createClientSocket(IServerSocket server, Selector selector, SocketChannel socketChannel) throws IOException
    {
        return new RemoteClientSocket(server, selector, socketChannel);
    }
}
